package com.mxf.code.cases.order;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.Feature;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * @author : [mxf]
 * @version : [v1.0]
 * @className : RabbitMqReturnCallback
 * @description : [描述说明该类的功能]
 * @createTime : [2022/9/21 19:28]
 * @updateUser : [mxf]
 * @updateTime : [2022/9/21 19:28]
 * @updateRemark : [描述说明本次修改内容]
 */
@Component
public class RabbitMqReturnCallback implements RabbitTemplate.ReturnCallback{
    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        Object parse = JSON.parse(message.getBody(), Feature.AllowArbitraryCommas);
        MessageRecord o = JSON.parseObject(parse.toString(), MessageRecord.class);
        System.out.println("测试");
    }
}
